<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //map
    let arr = ['1', '34', '9', '-4'];
    console.log(arr);
    arr = arr.map(s => parseInt(s));
    console.log(arr);

    //reduce
    const arr1 = [1,20,-5,3];
    let result1 = arr1.reduce((a, b) => a + b);
    console.log(result1);
    let result2 = arr1.reduce((a, b) => a * b);
    console.log(result2);
    let result3 = arr1.reduce((a, b) => a * b, 0);
    console.log(result3);
  </script>
</body>
</html>